import axios from '@u/request'
// 加入购物车
const addCart = (params = {}) => {
  return axios.post('/shopping-cart/add', params)
}
// 获取购物车数据
const fetchCartInfo = (params = {}) => {
  return axios.get('/shopping-cart/info', {params})
}
// 修改购物车商品购买数量
const changeItemNum = (params = {}) => {
  return axios.post('/shopping-cart/modifyNumber', params)
}
// 修改购物车 商品 选中状态
const cartItemSelected = (params = {}) => {
  return axios.post('/shopping-cart/select', params)
}
// 删除购物车中商品 /shopping-cart/remove
const removeItem = (params = {}) => {
  return axios.post('/shopping-cart/remove', params)
}

export {
  addCart,
  fetchCartInfo,
  changeItemNum,
  cartItemSelected,
  removeItem
}